package cn.edu.zxj.springconfig;

import cn.edu.zxj.springconfig.model.Dog;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class SpringConfigApplication {

    public static void main(String[] args) {
        // 获取 Spring 上下文
        ApplicationContext context =
                SpringApplication.run(SpringConfigApplication.class, args);

        // 从 Spring上下文中获取对象
        Dog dog = context.getBean(Dog.class);
        System.out.println(dog);
    }

}
